﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QVector>
#include <QStringList>
#include "pdflib.h"


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void initData();
private:
    bool SetPDFTitle(PDF *p, int orientation, const QString &title, const QString &subTitle, const QString &code);
    void orderLogHeader(PDF *p, float x, float & y);
    void orderLogContent(PDF *p, const QStringList & list, float x, float & y);
    void orderList02Header(PDF *p, float x, float & y);
    void filledOrderList03Header(PDF *p, float x, float & y);
    void approvedRejectedOrderListHeader(PDF *p, float x, float & y, bool type);
    void orderDetailsList06Header(PDF *p, float x, float & y);

    void orderListOR2Content(PDF *p, const QStringList & list, float x, float & y);
    void filledOrderListOR3Content(PDF *p, const QStringList & list, float x, float & y);
    void filledOrderListOR03Totol(PDF *p, const QString & list, float y);
    void approvedRejectedOrderListContent(PDF *p, const QStringList & list, float x, float & y);


    void pdfDrawForm(QPainter *paint, int y, int horzBorder, int row, int column, int unitHeight, QFont &font, QStringList &list);
private slots:
    void on_pushButton_clicked();

    void on_btnAEList_clicked();

    void on_btnOrderLog_clicked();

    void on_btnOrderList02_clicked();

    void on_btnFilledOrderList03_clicked();

    void on_btnApporedOrderList_clicked();



    void on_btnRejectOrderList05_clicked();

    void on_btnOrderDetailsList06_clicked();

    void on_btnUserListing_clicked();

    void on_pushButton_2_clicked();

private:
    Ui::MainWindow *ui;

    QVector<QStringList> m_vecAEList;
    QVector<QStringList> m_vecOrderLog;
    QVector<QStringList> m_vecOrderListOr2;
    QVector<QStringList> m_vecFilledOrderListOr3;
    QVector<QStringList> m_vecApprovedOrderListOr4;
};
#endif // MAINWINDOW_H
